package com.example.consumer.direct;


import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

@Slf4j
@Component
public class TopicReceiver {
    public static final String topic_man = "topic.man";
    public static final String topic_woman = "topic.woman";
    public final static String xxx = "xxx";

    @RabbitListener(queues = topic_man)
    @RabbitHandler
    public void topic_man(Map testMessage) {
        log.info("我是队列{} 收到消息：{}" ,topic_man, testMessage);
    }

    @RabbitListener(queues = topic_woman)
    @RabbitHandler
    public void topic_woman(Map testMessage) {
        log.info("我是队列{} 收到消息：{}" ,topic_woman, testMessage);
    }

    @RabbitListener(queues = xxx)
    @RabbitHandler
    public void xxx(Map testMessage) {
        log.info("我是队列{} 收到消息：{}" ,xxx, testMessage);
    }

}
